class VehicleMeta(type):
    @classmethod
    def __prepare__(metacls, name, bases, **kwargs):
        print('__prepare__', metacls, name, bases, kwargs)
        return kwargs

    def __new__(cls, name, bases, attrs, **kwargs):
        print('__new__', cls, name, bases, attrs, kwargs)

        def __repr__(self):
            return f'{self.__class__.__name__}(wheel={self.wheel}, type={self.type})'

        attrs.update({
            'wheel': 4,
            '__repr__': __repr__
        })
        clazz = super().__new__(cls, name, bases, attrs)
        return clazz


class Vehicle(metaclass=VehicleMeta):
    pass


class Bus(Vehicle):
    type = 1


class Truck(Vehicle):
    type = 2


bus = Bus()
truck = Truck()


# print(bus)
# print(truck)
# print(bus.wheel)
# print(bus.__dict__)


class Meta(type):
    def __new__(cls, name, bases, attrs, **kwargs):
        print(kwargs)
        return super().__new__(cls, name, bases, attrs)


class A(metaclass=Meta, a=1, b=2, c={'x': 1, "y": 2}):
    pass
